//
// Created by Administrator on 2024/3/25.
//
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
#define endl '\n'

#define L 0
#define U 1
const ll MOD = 1e9 + 7;
ll dp[2][2][32];//dp[x][y][k]代表长度为k且以xy结尾的且不含UUU串的数量
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    dp[L][L][2] = 1;
    dp[L][U][2] = 1;
    dp[U][L][2] = 1;
    dp[U][U][2] = 1;
    int n;
    cin >> n;
    for (int i = 3; i <= n; i++) {
        dp[L][L][i] = dp[L][L][i - 1] + dp[U][L][i - 1];
        dp[L][U][i] = dp[L][L][i - 1] + dp[U][L][i - 1];
        dp[U][L][i] = dp[L][U][i - 1] + dp[U][U][i - 1];
        dp[U][U][i] = dp[L][U][i - 1];

    }
    cout << ((1ll << n) - dp[L][L][n] - dp[L][U][n] - dp[U][L][n] - dp[U][U][n]) % MOD;
    return 0;
}